﻿Namespace Localization
    <System.Windows.Markup.MarkupExtensionReturnType(GetType(FlowDirection))> _
    Public Class FlowDirectionExtension
        Inherits System.Windows.Markup.MarkupExtension

        Public Overrides Function ProvideValue(ByVal serviceProvider As System.IServiceProvider) As Object
            If System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft Then
                Return FlowDirection.RightToLeft
            Else
                Return FlowDirection.LeftToRight
            End If
        End Function
    End Class
End Namespace